package cn.yunhe.shiro_demo.service;

import cn.yunhe.shiro_demo.dao.UserMapper;
import cn.yunhe.shiro_demo.entity.User;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service("userService")
public class UserServiceImpl implements IUserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User login(String name) {
        Map<String,Object> map = new HashMap<>();
        map.put("username",name);
        return userMapper.selectByMap(map).get(0);
    }
}
